<%@ page language="java" contentType="text/html; charset=UTF-8"%>
<%@ include file="/include/taglibs.jsp"%>

<style type="text/css">
body {
	background-image: url(../images/mainframe-bg.jpg);
	background-repeat: repeat-x;
	margin: 0px auto;
	padding: 0px;
	position: relative;
	text-align: center;
}
</style>

<script language="javascript">
<!--
function senfe(o,a,b,c,d){
var t=document.getElementById(o).getElementsByTagName("tr");
for(var i=0;i<t.length;i++){
t[i].style.backgroundColor=(t[i].sectionRowIndex%2==0)?a:b;
t[i].onclick=function(){
if(this.x!="1"){
this.x="1";//本来打算直接用背景色判断，FF获取到的背景是RGB值，不好判断
this.style.backgroundColor=d;
}else{
this.x="0";
this.style.backgroundColor=(this.sectionRowIndex%2==0)?a:b;
}
}
$(t[i]).mouseover(function(){
if(this.x!="1")this.style.backgroundColor=c;
});
$(t[i]).mouseout(function(){
if(this.x!="1")this.style.backgroundColor=(this.sectionRowIndex%2==0)?a:b;
});
}
}
$(document).ready(function (){
	//senfe("表格名称","奇数行背景","偶数行背景","鼠标经过背景","点击后背景");
	senfe("t_robotlog","#e5f1f4","#f8fbfc","#ecfbd4","#bce774");
});
--></script>

<script type="text/javascript">
/*function doDelete(id){
	var prompt = "确实要删除此告警吗？";
	if(window.confirm(prompt)){
		document.location.href = "<%=request.getContextPath()%>/alert.robotlognavi.do?action=delete&id="+id;
	}
}*/

function doSeleDelete(){  
	var prompt = "确实要删除选择设备吗？";	
	if(window.confirm(prompt)){
		var url_str = "<%=request.getContextPath()%>/ne.robotmanagenavi.do?method=delete&rnd"+Math.random();		
		frmList.action = url_str;		
		frmList.submit();	
	}
}

function doSeleAdd(){  
		var url_str = "<%=request.getContextPath()%>/ne.robotmanagenavi.do?method=add&rnd"+Math.random();
		frmList.action = url_str;		
		frmList.submit();	
}

function search(){			
   frmList.submit();	
}

</script>

<div>
<div style="text-align: left; color: red"><html:errors /></div>

<form id="frmList" action="ne.robotmanagequery.do" method="post">
<table width="100%" border="0" cellpadding="3" cellspacing="0"
	class="sanxuan" style="background-repeat: repeat;">
	<tbody>
		<tr>
			<td height="31" width="900px"
				style="font-size: 14px; color: white; text-align: center">&nbsp;设备查询</td>
		</tr>
		<tr>
			<td>
			<table border="0" width="95%" align="center">
				<tr align="left">
					<td><strong>设备名称:</strong> <input type="text" name="queryName"
						id="queryName" value="${queryName}" /></td>

					<td align="left"><img
						src="<%=request.getContextPath()%>/images/table/chaxun.gif"
						width="90" height="30" style="cursor: hand;"
						onclick="javascript:search();" /></td>
				</tr>
			</table>
			</td>
		</tr>
	</tbody>
</table>
<div class="guanli" style="float: right;"><br />
<input name="add" type="button" class="button" value="添加设备"
	onclick="javascript:doSeleAdd();" /> <input type="button"
	name="delete" class="button" value="批量删除"
	onclick="javascript:doSeleDelete();" /></div>
<table width="100%" cellpadding="4" class="liebiao" id="t_robotmanage"
	align="center">
	<thead>
		<tr>
			<td width="23" align="center"><input id="all" name="all"
				type="checkbox" onclick="list_select_all();" /></td>
			<td>设备名称</td>
			<td>所属区局</td>
			<td>通道</td>			
			<td>IP地址</td>
			<td>ComPort</td>
			<td>IrPort</td>
			<td>IrAgentPort</td>
			<td>VideoAgentPort</td>
			<td>QosAgentPort</td>
			<td>PicAgentPort</td>
			<td>操作</td>
		</tr>
	 </thead>
	<tbody>
		<c:forEach var='vo' items="${RA_PAGER_ITEMS}" varStatus="vs">
			<tr>
				<td class="list-value"><input id="id" name="id" type="checkbox"
					value="${vo.robotManage.idRobot}" onClick="list_check_selection()"></td>
				<td class="list-value">${vo.robotManage.name}
				</td>
				<td class="list-value">${vo.robotManage.regionManage.regionName}
				</td>	
				<td class="list-value">${vo.robotManage.channel}
				</td>			
				<td class="list-value">${vo.robotNetInfo.ipAddress}</td>
				<td class="list-value">${vo.robotNetInfo.comPort}</td>
				<td class="list-value">${vo.robotNetInfo.irPort}</td>
				<td class="list-value">${vo.robotNetInfo.irAgentPort}</td>
				<td class="list-value">${vo.robotNetInfo.videoAgentPort}</td>
				<td class="list-value">${vo.robotNetInfo.qosAgentPort}</td>
				<td class="list-value">${vo.robotNetInfo.picAgentPort}</td>
				
				<td class="list-value" style="width: 250px;"><a class="modify"
					href="ne.robotmanagenavi.do?method=modify&id=${vo.robotManage.idRobot}">编辑</a>
				<a class="setting"
					href="ne.robotmanagenavi.do?method=modifyNetInfo&id=${vo.robotManage.idRobot}">网络配置</a>
				<a class="setting"
					href="ne.robotmanagenavi.do?method=modifyCfg&id=${vo.robotManage.idRobot}">基本配置
				</a> <a class="setting"
					href="ne.robotmanagenavi.do?method=modifyFile&id=${vo.robotManage.idRobot}">文件配置</a>
				</td>
			</tr>
		</c:forEach>
	</tbody>
	<tfoot>
	</tfoot>
</table>
<br />
<div class="pagenav"><jsp:include page="/include/pager.jsp"
	flush="true" /></div>
</form>
</div>
<script type="text/javascript">
var st = new SortableTable( document.getElementById("t_robotmanage"), ["None","String", "String","String", "String","String","String","String" ,"None"],'#E4EEF7','white','#FF9900');
 //*定时更新页面
window.setInterval("toRefresh()", 5*60*1000);       
</script>